<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>test</title>
  <!-- 引入Vue -->
  <script type="text/javascript" src="../../js/vue.js"></script>
</head>

<body>
  <!-- 准备好一个容器-->
  <div id="demo">
    <!-- 按下回车键 -->
    <input type="text" @keyup.enter='showT' placeholder="请敲一下回车"><br>
    <!-- <input type="text" @keyup.Enter='showT' placeholder="请敲一下回车"><br>
    <input type="text" @keyup.13='showT' placeholder="请敲一下回车"><br> -->
    <!-- 按下删除键 -->
    <input type="text" @keyup.delete='showT' placeholder="请敲一下删除"><br>
    <!-- 按下退出键 -->
    <input type="text" @keyup.esc='showT' placeholder="请敲一下退出"><br>
    <!-- 按下空格键 -->
    <input type="text" @keyup.space='showT' placeholder="请敲一下空格"><br>
    <!-- 按下换行键 -->
    <input type="text" @keydown.tab='showT' placeholder="请敲一下换行"><br>
    <!-- 按下上行键 -->
    <input type="text" @keyup.up='showT' placeholder="请敲一下上行键"><br>
    <!-- 按下下行键 -->
    <input type="text" @keyup.down='showT' placeholder="请敲一下下行键"><br>
    <!-- 按下左行键 -->
    <input type="text" @keyup.left='showT' placeholder="请敲一下左行键"><br>
    <!-- 按下右行键 -->
    <input type="text" @keyup.right='showT' placeholder="请敲一下右行键"><br>
  </div>
</body>

<script type="text/javascript">
  // 创建Vue实例，得到ViewModel
  var vm = new Vue({
    el: '#demo',
    methods: {
      showT(e) {
        console.log(e.target.value);
      }
    }
  })
</script>

</html>